package cn.zhentao.charge.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.zhentao.charge.mapper.ChargeStationInfoMapper;
import cn.zhentao.charge.domain.ChargeStationInfo;
import cn.zhentao.charge.service.IChargeStationInfoService;

/**
 * 充电站Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-15
 */
@Service
public class ChargeStationInfoServiceImpl implements IChargeStationInfoService 
{
    @Autowired
    private ChargeStationInfoMapper chargeStationInfoMapper;

    /**
     * 查询充电站
     * 
     * @param id 充电站主键
     * @return 充电站
     */
    @Override
    public ChargeStationInfo selectChargeStationInfoById(Integer id)
    {
        return chargeStationInfoMapper.selectChargeStationInfoById(id);
    }

    /**
     * 查询充电站列表
     * 
     * @param chargeStationInfo 充电站
     * @return 充电站
     */
    @Override
    public List<ChargeStationInfo> selectChargeStationInfoList(ChargeStationInfo chargeStationInfo)
    {
        return chargeStationInfoMapper.selectChargeStationInfoList(chargeStationInfo);
    }

    /**
     * 新增充电站
     * 
     * @param chargeStationInfo 充电站
     * @return 结果
     */
    @Override
    public int insertChargeStationInfo(ChargeStationInfo chargeStationInfo)
    {
        chargeStationInfo.setCreateTime(DateUtils.getNowDate());
        return chargeStationInfoMapper.insertChargeStationInfo(chargeStationInfo);
    }

    /**
     * 修改充电站
     * 
     * @param chargeStationInfo 充电站
     * @return 结果
     */
    @Override
    public int updateChargeStationInfo(ChargeStationInfo chargeStationInfo)
    {
        return chargeStationInfoMapper.updateChargeStationInfo(chargeStationInfo);
    }

    /**
     * 批量删除充电站
     * 
     * @param ids 需要删除的充电站主键
     * @return 结果
     */
    @Override
    public int deleteChargeStationInfoByIds(Integer[] ids)
    {
        return chargeStationInfoMapper.deleteChargeStationInfoByIds(ids);
    }

    /**
     * 删除充电站信息
     * 
     * @param id 充电站主键
     * @return 结果
     */
    @Override
    public int deleteChargeStationInfoById(Integer id)
    {
        return chargeStationInfoMapper.deleteChargeStationInfoById(id);
    }
}
